package com.dragon.logical.service.finance;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.dragon.repository.entity.AddPageData;
import com.dragon.repository.entity.CustomerPayment;
import com.dragon.repository.entity.PaymentContract;
import com.dragon.repository.entity.PlanCollect;
import org.springframework.web.bind.annotation.RequestParam;

import javax.servlet.http.HttpServletRequest;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 回款表 服务类
 * </p>
 *
 * @author sy
 * @since 2023-07-03
 */
public interface ICustomerPaymentService extends IService<CustomerPayment> {

    Page<CustomerPayment> paymentList(Integer page, Integer limit, String search, Integer type,Integer status, Integer paymentStatus,String startTime, String endTime);

    void addPayment(CustomerPayment payment);

    void updatePayment(CustomerPayment payment);

    void deletePayment(Integer id);

    List<CustomerPayment> selectByContractId(Integer contract);

    CustomerPayment detailById(Integer id);

    Map<String, Object> getAmount(Integer adminId, String year,String yearMonth);

    //Double selectMoneyByPlanIdAndControllerId(Integer planId, Integer contractId);
    List<PlanCollect> selectMoneyByPlanIdAndControllerId(String planIds);

    Map<String,Object> getReceivablesMoney(Integer adminId, String year);

    Map<String, Object> getPaidMoney(Integer adminId, String year, Integer type);

    Map<String, Object> getReceivablesPercentage(Integer adminId ,String year ,Integer type);

    Map<String, Object> currenDate(HttpServletRequest request, Integer adminId);

    /**
     * 回款反审核
     * @param correlationId
     */
    void antiAudit(Integer correlationId);

    Double selectMoneyByBillId(Integer billId);

    Double selectMoneyByPlanId(Integer planId, Integer contractId);

    Page<PaymentContract> selectPlanCollectDetail(Integer planId, Integer page, Integer limit);

    Page<CustomerPayment> selectCustomerPaymentDetail(Integer billId, Integer page, Integer limit);

    Map<String,Object> selectListStatistics();

    /**
     * 当前年各个月实收金额
     * @param time
     * @return
     */
    LinkedHashMap<String,Object> customerPaymentMonthlyStatistics(String time);
}
